package chongxin;
import java.util.Scanner;
public class learn6 {
    private String usname;
    private String num;
    //无参构造方法
public learn6(){
}
//有参构造方法
    public learn6(String usname, String num) {
        this.usname = usname;
        this.num = num;
    }

    public String getUsname() {
        return usname;
    }

    public void setUsname(String usname) {
        this.usname = usname;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }
    public void print(String usname,String num){
    setUsname(usname);
    setNum(num);
    System.out.println("用户名为"+getUsname()+"\n"+"密码为:"+getNum());}
//测试类
    public static void main(String[] args) {
    //控制台输入
    Scanner sc=new Scanner(System.in);
    //调用对象
        learn6 the=new learn6();
        //调用类的方法
        the.print(sc.next(),sc.next());
    }
}
